<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            border: 1px solid;
        }
        a:link{
            color: red;
        }
        a:visited{
            color: yellow;
        }
        a:hover{
            color: blue;
        }
        a:active{
            color: green;
        }
        div .d1{
            color: yellow;
        }

    </style>
</head>
<body>
    <div class="d1" href="">
        <a href="">文字颜色</a>
    </div>
    <div class="d1" style="color:red">
        css优先级
    </div>
    
</body>
</html>